"""
按字符分割
这是最简单的方法。它基于给定的字符序列进行分割，默认值为"\n\n"。块长度以字符数来衡量。
"""
from langchain_text_splitters import CharacterTextSplitter

file_path = "../data/document/公司管理制度.txt"
with open(file_path, "r", encoding="utf-8") as f:
    texts = f.read()

splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)

documents = splitter.create_documents([texts])
print(len(documents))
